import request from '@/utils/request'

export function list() {
  return request({
    url: '/admin/edu/teacher/listAll',
    method: 'get'
  })
}

export function pageList(currentPage, limit, searchObj) {
  return request({
    url: `/admin/edu/teacher/list/${currentPage}/${limit}`,
    method: 'get',
    params: searchObj
  })
}

export function save(teacherObj) {
  return request({
    url: `/admin/edu/teacher/add`,
    method: 'post',
    data: teacherObj
  })
}

export function update(teacherObj) {
  return request({
    url: `/admin/edu/teacher/update`,
    method: 'put',
    data: teacherObj
  })
}

export function removeById(id) {
  return request({
    url: `/admin/edu/teacher/remove/${id}`,
    method: 'delete'
  })
}

export function batchRemove(ids) {
  return request({
    url: `/admin/edu/teacher/batchRemove`,
    method: 'delete',
    data: ids
  })
}

export function getById(id) {
  return request({
    url: `/admin/edu/teacher/get/${id}`,
    method: 'get'
  })
}

export function getByName(name) {
  return request({
    url: `/admin/edu/teacher/getNames/${name}`,
    method: 'get'
  })
}
